include('shared.lua')

local glowMat = Material("sprites/light_glow02_add")

ENT.Team = -1
ENT.spriteColor = Color(255,255,255,255)

function ENT:Think()
	if self.Team == -1 then
		if self.Entity:GetNetworkedBool("blueteam") then
			self.Team = TEAM_BLUE
		else
			self.Team = TEAM_RED
		end
		if self.Team == TEAM_BLUE then
			self.Entity:SetColor(112,160,255,255)
			self.spriteColor = Color(128,160,255,255)
		elseif self.Team == TEAM_RED then
			self.Entity:SetColor(255,96,56,255)
			self.spriteColor = Color(255,96,64,255)
		end
	end
end

function ENT:Draw()
	if self.Team == TEAM_BLUE then
		self.Entity:SetColor(112,160,255,255)
		self.spriteColor = Color(128,160,255,255)
	elseif self.Team == TEAM_RED then
		self.Entity:SetColor(255,96,56,255)
		self.spriteColor = Color(255,96,64,255)
	end
	render.SetMaterial(glowMat)
	render.DrawSprite(self.Entity:GetPos(),56,56,self.spriteColor)
	self.Entity:DrawModel()
end